package business.ebo;

import business.ebi.CommodityEBI;
import dao.dai.CommodityDao;
import dao.factory.DaoFactory;
import entity.Commodity;
import java.sql.SQLException;
import java.util.List;

public class CommodityEBO implements CommodityEBI {

    private final CommodityDao cd = DaoFactory.getCommodityDao();

    @Override
    public boolean insert(Commodity commodity) throws SQLException {
        return cd.insert(commodity);
    }

    @Override
    public boolean delete(String cId) throws SQLException {
        return cd.delete(cId);
    }

    @Override
    public boolean update(String oldcId, Commodity commodity) throws SQLException {
        return cd.update(oldcId,commodity);
    }

    @Override
    public Commodity search_id(String cId) throws SQLException {
        return cd.search_id(cId);
    }

    @Override
    public List<Commodity> search_name(String cName) throws SQLException {
        return cd.search_name(cName);
    }

    @Override
    public List<Commodity> findAll() throws SQLException {
        return cd.findAll();
    }
}